<%--
  Created by IntelliJ IDEA.
  User: lenovo
  Date: 2021/1/24
  Time: 13:53
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="UTF-8">
<%@include file="/WEB-INF/include-head.jsp" %>
<script type="text/javascript">
    $(function () {
        console.log("ajax 函数之前");

        $("#async").click(function () {
            $.ajax({
                url: "test/ajax/async.html",
                type: "post",
                dataType: "text",
                async:false,
                success: function (response) {
                    console.log("ajax 函数" + response)
                }
            });

            console.log("ajax 函数之后")
        })
    })
</script>
<body>

<%@include file="/WEB-INF/include-nav.jsp" %>

<div class="container-fluid">
    <div class="row">
        <%@include file="/WEB-INF/include-sidebar.jsp" %>
        <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
            <button id="async">发送ajax请求</button>
        </div>
    </div>
</div>

</body>
</html>

